package com.cn.designpatterns.ex.concrete.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: zhangyi
 * @date: 2019/1/10 15:42
 * @description:
 */
public class Waiter {

    private List<Command> commands = new ArrayList<>();

    public List<Command> getCommands() {
        return commands;
    }

    public void setCommands(List<Command> commands) {
        this.commands = commands;
    }

    /**
     * 设置订单
     *
     * @param command
     */
    public void setOrders(Command command){
        commands.add(command);
    }

    public void cancelOrders(Command command){
        commands.remove(command);
    }

    public void markAll(){
        for(Command command : commands){
            System.out.println("ALL OUT"+command);
        }
    }
}
